home *** CD-ROM | disk | FTP | other *** search
/ Codemasters Artwork Disc ECTS 2000 ( UK) / Codemasters - Artwork Disc ECTS 2000 (UK).bin / pc / xtras / medial~1 / setfx~1.dir / Internal_282_Memory Script.ls < prev    next >
Encoding:
Text File  |  1998-12-01  |  1.2 KB  |  46 lines

  1. on mouseDown
  2.   global fxTrackingObj, version
  3.   set cLoc to the clickLoc
  4.   set c to the clickOn
  5.   set H to the locH of cLoc - the locH of sprite c
  6.   set v to the locV of cLoc - the locV of sprite c
  7.   if H > 21 then
  8.     exit
  9.   end if
  10.   if v > 13 then
  11.     set action to "get"
  12.   else
  13.     set action to "set"
  14.   end if
  15.   repeat while the stillDown
  16.     set H to the mouseH - the locH of sprite c
  17.     set v to the mouseV - the locV of sprite c
  18.     set n to ((H - 21) / 18) + 1 + (v / 13 * 4)
  19.     if (H < 21) or (v < 0) or (v > 26) or (n < 1) or (n > 8) then
  20.       set the member of sprite c to member ("memory" && action)
  21.     else
  22.       set the member of sprite c to member ("memory" && action && n)
  23.     end if
  24.     updateStage()
  25.   end repeat
  26.   if (H < 21) or (v < 0) or (v > 26) or (n < 1) or (n > 8) then
  27.     exit
  28.   end if
  29.   if not objectp(fxTrackingObj) then
  30.     exit
  31.   end if
  32.   if value(char 1 to 3 of version) < 6 then
  33.     alert("Memory buttons require Director 6 or later.")
  34.     exit
  35.   end if
  36.   if action = "set" then
  37.     setMemory(fxTrackingObj, n)
  38.   else
  39.     if action = "get" then
  40.       getMemory(fxTrackingObj, n)
  41.     end if
  42.   end if
  43.   set the member of sprite c to member "memory"
  44.   puppetSprite(c, 0)
  45. end
  46.